package com.boge.controller;

import com.boge.service.ChatBotService;
import dev.langchain4j.model.chat.ChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
public class ChatBotController {

    @Autowired
    private ChatBotService service;

    @GetMapping("/chat")
    public String chat(@RequestParam(value = "message",defaultValue = "介绍下你自己") String message) {
        return service.sendMessage(message);
    }

    @GetMapping("/chatStreaming")
    public Flux<String> chatStreaming(@RequestParam(value = "message",defaultValue = "介绍下你自己") String message
    ,String memoryId) {
        return service.sendFluxMessage(memoryId,message);
    }
}
